package com.linkhub.oms.admin.modules.user.account.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckRole;
import com.linkhub.oms.admin.modules.satoken.session.LhSessionContext;
import com.linkhub.oms.admin.modules.user.account.domain.vo.UserAccountVO;
import com.linkhub.oms.admin.modules.user.account.service.IUserAccountService;
import com.linkhub.oms.common.constant.RoleConstant;
import com.linkhub.oms.common.response.DataResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户账户模块
 *
 * @author Frank
 */
@Slf4j
@RestController
@Api(tags = {"用户账户模块接口"})
@RequestMapping("/user/account")
@SaCheckLogin
public class UserAccountController {

    @Resource
    private IUserAccountService userAccountService;

    @GetMapping()
    @ApiOperation(value = "查询用户账户信息")
    @SaCheckRole(value = RoleConstant.CUSTOMER)
    public DataResponse<UserAccountVO> getUserAccount() {
        return DataResponse.success(userAccountService.getUserAccount(LhSessionContext.getUserId()));
    }



}
